home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / non-ANSI / c-client / os_sv2.c < prev    next >
C/C++ Source or Header  |  1996-02-07  |  4KB  |  150 lines

  1. /*
  2.  * Program:    Operating-system dependent routines -- SVR2 version
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    10 April 1992
  13.  * Last Edited:    7 February 1996
  14.  *
  15.  * Copyright 1996 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. #include "tcp_unix.h"        /* must be before osdep includes tcp.h */
  37. #include "mail.h"
  38. #include "osdep.h"
  39. #undef flock
  40. #include <ctype.h>
  41. #include <stdio.h>
  42. #include <sys/stat.h>
  43. #include <netinet/in.h>
  44. #include <arpa/inet.h>
  45. #include <netdb.h>
  46. #include <errno.h>
  47. extern int errno;
  48. #include <pwd.h>
  49. #include <grp.h>
  50. #include <sys/socket.h>
  51. #include <time.h>
  52. #define KERNEL
  53. #include <sys/time.h>
  54. #undef KERNEL
  55. #include "misc.h"
  56.  
  57. #define DIR_SIZE(d) sizeof (DIR)
  58.  
  59. extern int sys_nerr;
  60. extern char *sys_errlist[];
  61.  
  62. #define toint(c)    ((c)-'0')
  63. #define isodigit(c)    (((unsigned)(c)>=060)&((unsigned)(c)<=067))
  64.  
  65. #define    NBBY    8    /* number of bits in a byte */
  66. #define    FD_SETSIZE    256
  67.  
  68. typedef long    fd_mask;
  69. #define NFDBITS    (sizeof(fd_mask) * NBBY)
  70.                     /* bits per mask */
  71. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  72.  
  73. typedef    struct fd_set {
  74.   fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  75. } fd_set;
  76.  
  77. #define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= \
  78.                     (1 << ((n) % NFDBITS)))
  79. #define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= \
  80.                     ~(1 << ((n) % NFDBITS)))
  81. #define    FD_ISSET(n, p)    ((p)->fds_bits[(n)/NFDBITS] & \
  82.                     (1 << ((n) % NFDBITS)))
  83. #define FD_ZERO(p)    bzero((char *)(p), sizeof(*(p)))
  84.  
  85. #define initgroups(a,b)        /* do nothing */
  86.  
  87.  
  88. #include "fs_unix.c"
  89. #include "ftl_unix.c"
  90. #include "nl_unix.c"
  91. #include "env_unix.c"
  92. #include "tcp_unix.c"
  93. #include "log_std.c"
  94. #include "gr_wait.c"
  95. #include "flock.c"
  96. #include "opendir.c"
  97. #include "scandir.c"
  98. #include "memmove2.c"
  99. #include "strstr.c"
  100. #include "strerror.c"
  101. #include "strtoul.c"
  102. #include "tz_sv4.c"
  103. #include "gethstid.c"
  104. #include "fsync.c"
  105. #undef setpgrp
  106. #include "setpgrp.c"
  107. #include "writevs.c"
  108.  
  109. /* Emulator for BSD syslog() routine
  110.  * Accepts: priority
  111.  *        message
  112.  *        parameters
  113.  */
  114.  
  115. int syslog (priority,message,parameters)
  116.      int priority;
  117.      char *message;
  118.      char *parameters;
  119. {
  120.   /* nothing here for now */
  121. }
  122.  
  123.  
  124. /* Emulator for BSD openlog() routine
  125.  * Accepts: identity
  126.  *        options
  127.  *        facility
  128.  */
  129.  
  130. int openlog (ident,logopt,facility)
  131.      char *ident;
  132.      int logopt;
  133.      int facility;
  134. {
  135.   /* nothing here for now */
  136. }
  137.  
  138.  
  139. /* Emulator for BSD ftruncate() routine
  140.  * Accepts: file descriptor
  141.  *        length
  142.  */
  143.  
  144. int ftruncate (fd,length)
  145.      int fd;
  146.      unsigned long length;
  147. {
  148.   return -1;            /* gotta figure out how to do this */
  149. }
  150.